/*
* 字符串暴力搜索
* */
;(function(window){
	function research(string, pat, point, ln, max){
		var substr = string.substr(point, ln),
				i=ln-1;
		for(;i>-1;i--){
			if( substr[i]!=pat[i] ){
				break;
			}
		}
		if( i == -1 ) return point;
		if( point + 1 > max ) return null;
		return research(string, pat, point+1, ln, max);
	}

	window.BruteForceSearch = function(string, pat){
		return research(string, pat, 0, pat.length-1, string.length);
	};

})(window);